<%@LANGUAGE="VBSCRIPT" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test user name</title>
</head>

<body>
<script type="text/vbscript">
Dim objNet
On Error Resume Next 

'In case we fail to create object then display our custom error'

Set objNet = CreateObject("WScript.NetWork") 
If  Err.Number <> 0 Then                'If error occured then display notice'
	MsgBox "Don't be Shy." & vbCRLF &_
               "Do not press ""No"" If your browser warns you."
	Document.Location = "TestUserName.asp"	  
                                        'Place the Name of the document. '
	                                'It will display again'
End if
	
Dim strInfo
strInfo = "User Name is     " & objNet.UserName & vbCRLF & _
          "Computer Name is " & objNet.ComputerName & vbCRLF & _
          "Domain Name is   " & objNet.UserDomain
MsgBox strInfo
	
Set objNet = Nothing 
</script>
</body>
</html>
